//
//  Target_DroneManager.m
//  DJILogin
//
//  Created by wenpd on 2021/4/2.
//

#import "Target_DroneManager.h"
#import "DJIDroneManager.h"

@implementation Target_DroneManager

- (void)Action_init:(NSDictionary*)params{
    [DJIDroneManager shareMagager];
}

- (RACSubject *)Action_getSubject:(NSDictionary*)params{
    RACSubject *subject;
    if(params){
        NSString* subName = params[@"subject_name"];
        if([subName isEqual: @"aircraftSingal"]) {
            subject = [DJIDroneManager shareMagager].aircraftSingal;
        } else if([subName isEqual: @"fcStateSingal"]){
            subject = [DJIDroneManager shareMagager].fcStateSingal;
        } else if([subName isEqual: @"imuStateSingal"]){
            subject = [DJIDroneManager shareMagager].imuStateSingal;
        } else if([subName isEqual: @"onBoardSingal"]){
            subject = [DJIDroneManager shareMagager].onBoardSingal;
        } else if([subName isEqual: @"rtkStateSingal"]){
            subject = [DJIDroneManager shareMagager].rtkStateSingal;
        } else if([subName isEqual: @"rtkStationSingal"]){
            subject = [DJIDroneManager shareMagager].rtkStationSingal;
        } else if([subName isEqual: @"cameraStateSingal"]){
            subject = [DJIDroneManager shareMagager].cameraStateSingal;
        } else if([subName isEqual: @"sdcardStateSingal"]){
            subject = [DJIDroneManager shareMagager].sdcardStateSingal;
        } else if([subName isEqual: @"mediaSingal"]){
            subject = [DJIDroneManager shareMagager].mediaSingal;
        } else if([subName isEqual: @"gimbalStateSingal"]){
            subject = [DJIDroneManager shareMagager].gimbalStateSingal;
        } else if([subName isEqual: @"batteryStateSingal"]){
            subject = [DJIDroneManager shareMagager].batteryStateSingal;
        }
    }
    return subject;
}

- (NSDictionary*)Action_getProduct:(NSDictionary*)params{
    return [NSDictionary dictionaryWithObjectsAndKeys:[DJIDroneManager shareMagager].aircraft, @"product", nil];
}

- (BOOL)Action_isConnect:(NSDictionary*)params{
    return [DJIDroneManager shareMagager].isDroneConnect;
}

- (BOOL)Action_isM300Rtk:(NSDictionary*)params{
    return [DJIDroneManager shareMagager].isM300RTK;
}
@end
